public class Matrix {
    /*
    public static int minBags(int apple) {
		if (apple < 0) {
			return -1;
		}
		int bag6 = -1;
		int bag8 = apple / 8;
		int rest = apple - 8 * bag8;
		while (bag8 >= 0 && rest < 24) {
			int restUse6 = minBagBase6(rest);
			if (restUse6 != -1) {
				bag6 = restUse6;
				break;
			}
			rest = apple - 8 * (--bag8);
		}
		return bag6 == -1 ? -1 : bag6 + bag8;
	}

	// 如果剩余苹果rest可以被装6个苹果的袋子搞定，返回袋子数量
	// 不能搞定返回-1
	public static int minBagBase6(int rest) {
		return rest % 6 == 0 ? (rest / 6) : -1;
	}

	public static int minBagAwesome(int apple) {
		if ((apple & 1) != 0) { // 如果是奇数，返回-1
			return -1;
		}
		if (apple < 18) {
			return apple == 0 ? 0 : (apple == 6 || apple == 8) ? 1
					: (apple == 12 || apple == 14 || apple == 16) ? 2 : -1;
		}
		return (apple - 18) / 8 + 3;
	}
     */

    /*
    // n份青草放在一堆
	// 先手后手都绝顶聪明
	// string "先手" "后手"
	public static String winner1(int n) {
		// 0  1  2  3 4
		// 后 先 后 先 先
		if (n < 5) { // base case
			return (n == 0 || n == 2) ? "后手" : "先手";
		}
		// n >= 5 时
		int base = 1; // 当前先手决定吃的草数
		// 当前是先手在选
		while (base <= n) {
			// 当前一共n份草，先手吃掉的是base份，n - base 是留给后手的草
			// 母过程 先手 在子过程里是 后手
			if (winner1(n - base).equals("后手")) {
				return "先手";
			}
			if (base > n / 4) { // 防止base*4之后溢出
				break;
			}
			base *= 4;
		}
		return "后手";
	}

	public static String winner2(int n) {
		if (n % 5 == 0 || n % 5 == 2) {
			return "后手";
		} else {
			return "先手";
		}
	}
     */

    /*
    public static boolean isMSum1(int num) {
		for (int i = 1; i <= num; i++) {
			int sum = i;
			for (int j = i + 1; j <= num; j++) {
				if (sum + j > num) {
					break;
				}
				if (sum + j == num) {
					return true;
				}
				sum += j;
			}
		}
		return false;
	}

	public static boolean isMSum2(int num) {
		if (num < 3) {
			return false;
		}
		return (num & (num - 1)) != 0;
	}
     */

    /*
    class Solution {
    public int[][] generateMatrix(int n) {
        int[][] res = new int[n][n];
        int up = 0, down = n - 1, left = 0, right = n - 1, index = 1;
        while(index <= n * n){
            for(int i = left; i <= right; i++){
                res[up][i] = index++;
            }
            up++;
            for(int i = up; i <= down; i++){
                res[i][right] = index++;
            }
            right--;
            for(int i = right; i >= left; i--){
                res[down][i] = index++;
            }
            down--;
            for(int i = down; i >= up; i--){
                res[i][left] = index++;
            }
            left++;
        }
        return res;
    }
}
     */

    /*
    class Solution {
    public void rotate(int[][] matrix) {
        int a = 0;
        int b = 0;
        int c = matrix.length - 1;
        int d = matrix[0].length - 1;
        while (a < c) {
            process(matrix, a++, b++, c--, d--);
        }
    }

    public void process(int[][]matrix, int a, int b, int c, int d) {
        int temp = 0;
        for (int i = 0; i < d - b; i++) {
            temp = matrix[a][b + i];
            matrix[a][b + i] = matrix[c - i][b];
            matrix[c - i][b] = matrix[c][d - i];
            matrix[c][d - i] = matrix[a + i][d];
            matrix[a + i][d] = temp;
        }
    }
}
     */

    /*
    class Solution {
    public List<Integer> spiralOrder(int[][] matrix) {
        List<Integer> ans = new ArrayList<Integer>();
        int tR = 0;
        int tC = 0;
        int dR = matrix.length - 1;
        int dC = matrix[0].length - 1;
        while (tR <= dR && tC <= dC) {
            process(matrix, tR++, tC++, dR--, dC--, ans);
        }
        return ans;
    }

    public void process(int[][]matrix, int tR, int tC, int dR, int dC, List<Integer> ans) {
        if (tR == dR) {
            for (int i = tC; i<= dC; i++) {
                ans.add(matrix[tR][i]);
            }
        } else if (tC == dC) {
            for (int i = tR; i<= dR; i++) {
                ans.add(matrix[i][tC]);
            }
        } else {
            int curR = tR;
            int curC = tC;
            while (curC != dC) {
                ans.add(matrix[tR][curC]);
                curC++;
            }
            while (curR != dR) {
                ans.add(matrix[curR][dC]);
                curR++;
            }
            while (curC != tC) {
                ans.add(matrix[dR][curC]);
                curC--;
            }
            while (curR != tR) {
                ans.add(matrix[curR][tC]);
                curR--;
            }
        }
    }
}
     */

    /*
    class Solution {
    public int[] findDiagonalOrder(int[][] mat) {
        List<Integer> ans = new ArrayList<Integer>();
        int tC = 0;
        int tR = 0;
        int dC = 0;
        int dR = 0;
        int endR = mat.length - 1;
        int endC = mat[0].length - 1;
        boolean flag = false;
        while (tR < endR + 1) {
            process(mat, tR, tC, dR, dC, ans, flag);
            tR = tC == endC ? tR + 1: tR;
            tC = tC == endC ? tC : tC + 1;
            dC = dR == endR ? dC + 1 : dC;
            dR = dR == endR ? dR : dR + 1;
            flag = !flag;
        }
        int[] ret = new int[ans.size()];
        for (int i = 0; i < ans.size(); i++) {
            ret[i] = ans.get(i);
        }
        return ret;
    }

     public void process(int[][] matrix, int tR, int tC, int dR, int dC, List<Integer> ans, boolean flag) {
        if  (flag) {
            while (tR != dR + 1) {
                ans.add(matrix[tR++][tC--]);
            }
        } else {
            while (dR != tR - 1) {
                ans.add(matrix[dR--][dC++]);
            }
        }
    }
}
     */

    public static void main(String[] args) {
        System.out.println("but... I can't stop");
    }
}
